package hl.games.tankwar.factorys;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import hl.games.tankwar.core.ATank;
import hl.games.tankwar.entity.EnemyTanks;
import hl.games.tankwar.entity.PlayerTank;
import hl.games.tankwar.ui.R;

public abstract class TankFactory {
	public static ATank CreatePlayerTank(Context context)
	{
		Bitmap playerBitmap=BitmapFactory.decodeResource(context.getResources(), R.drawable.player1);
		ATank tank=new PlayerTank(playerBitmap, 16,16);
		
		return tank;
	}
	
	public static ATank CreateEnemyTank(Context context,int tankClass,int locationX,int locationY){
		int bitmapID=0;
		switch (tankClass) {
		case EnemyTanks.FAST_TANK:
			bitmapID=R.drawable.enemy2;

			break;
		case EnemyTanks.MID_TANK:
			bitmapID=R.drawable.enemy1;

			break;
		case EnemyTanks.HEAVY_TANK:
			bitmapID=R.drawable.enemy3;

			break;
		}
		Bitmap image=BitmapFactory.decodeResource(context.getResources(), bitmapID);
		ATank enemyTank=new EnemyTanks(image,16,16,tankClass);
		enemyTank.setPosition(locationX, locationY);
		return enemyTank;
	}
}
